package com.ljy.crawler.controller;


import com.ljy.crawler.entity.JdItem;
import com.ljy.crawler.service.IJdItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

import java.util.List;

/**
 * <p>
 * 京东商品表 前端控制器
 * </p>
 *
 * @author liangjiayy
 * @since 2022-01-25
 */
@Controller
public class JdItemController {

    @Autowired
    IJdItemService service;

    @GetMapping("findAll")
    public String findAll(Model model){
        List<JdItem> list = service.list();
        model.addAttribute("items",list);
        return "findAll";
    }
}
